<?php
namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Cache;

use Log;

/**
 * 
 * @author yanming
 * @todo 建立数据存储结构
 */
class AjaxWxJsApiController extends Controller
{
	public function doGetDefaultData(){
		return '{"countDevicePed":1,"deviceBindingState":3,"enterpriseIndex_url":"","enterpriseLogoUrl":"","indexAchievementData":{"cumulativeStep":19721,"imageUrl":"http://wx.qlogo.cn/mmopen/ia5g0exKT7ZKuPBAxKwdDJceGpVIEIhibfibs2k1uJKj6IjqviapFUTalRXTEOtDcwIAicVD5EpYWhAOKdH5bt1A1feRzvnibxYtzj/0","level":"1","name":"大山"},"indexDekaronData":{"dekaron":{"badgeId":"01addb1d0b0749fea6d8e57713da3ac3","bet":5,"bonus":20,"calorieValue":0,"create_time":null,"distanceValue":0,"finishTime":7,"finishType":1,"id":"1","level":1,"remind":"期间任何一天没达到6000步都算失败，并没收押注5分","stepValue":6000,"template":1,"valueType":1},"dekaronCalories":0,"dekaronDay":0,"dekaronDistance":0,"dekaronStep":0,"dm":null,"fulfill":"","isSuccess":"0","isfinish":0,"memberId":"","msg":"","pedometerPoint":0,"status":4,"template":0,"updateRecordDay":0,"valueType":0},"indexPedometerData":{"dateDay":"1分钟前","deviceBindingState":3,"hLine":4500,"nullTips":"无运动记录","stepDay":"0","stepPre":"0%","weekPre":"0%","xLables":["一","二","三","四","五","六","日"],"yValues":[]},"indexSleepData":null,"indexWeightData":null,"isFirstUse":0,"memberFunctionList":[{"functionId":"3","id":"0ca9cb959d8840c39c9f52eeace0a6c4","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","name":"睡眠","open":1,"sequence":1,"url":"mod-sleep"},{"functionId":"0","id":"d41bbb278a0c4ba7816e7542ea42a80b","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","name":"运动","open":1,"sequence":2,"url":"mod-pedometer"},{"functionId":"1","id":"77b851382d034929b1f0d5967f4c8ed7","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","name":"挑战","open":1,"sequence":3,"url":"mod-dekaron"}]}
';
	}

	public function doGetSportData(){}

	public function	doGetSportDataOfPage(){
		return '{"calories":0,"chartArray":[{"birthday":0,"boy":false,"chartData":[],"endTime":0,"isFirst":1,"isLast":0,"pedometerGoal":"4500","startTime":1436112000000,"timeText":"今天","timeType":1,"xLabels":["0","6","12","18","24"],"xMax":1436198400000,"xMin":1436112000000,"yLabels":["30","48","66","84","102","120"],"yLabels_right":[],"yMax":120,"yMax_right":0,"yMin":30,"yMin_right":0},{"birthday":0,"boy":false,"chartData":[],"endTime":0,"isFirst":1,"isLast":0,"pedometerGoal":"4500","startTime":1436112000000,"timeText":"今天","timeType":1,"xLabels":["0","6","12","18","24"],"xMax":1436198400000,"xMin":1436112000000,"yLabels":["30","48","66","84","102","120"],"yLabels_right":[],"yMax":120,"yMax_right":0,"yMin":30,"yMin_right":0},{"birthday":0,"boy":false,"chartData":[],"endTime":0,"isFirst":1,"isLast":0,"pedometerGoal":"4500","startTime":1436112000000,"timeText":"今天","timeType":1,"xLabels":["0","6","12","18","24"],"xMax":1436198400000,"xMin":1436112000000,"yLabels":["30","48","66","84","102","120"],"yLabels_right":[],"yMax":120,"yMax_right":0,"yMin":30,"yMin_right":0}],"distance":0,"lastRecordDate":{"date":4,"day":6,"hours":16,"minutes":23,"month":6,"seconds":58,"time":1435998238000,"timezoneOffset":-480,"year":115},"mathNum":"0.7062994344159961","pedometerGoal":4500,"reloadTime":30000,"step":0,"stepDate":"今天","stepPercent":"0%","timeType":1}';
	}

	public function doGetSleepData(){
		return '{"checkVersion":0,"hLine":0,"nullTips":"无睡眠记录","sleepHoursM":0,"sleepQuality":"","weekSleep":0,"xLables":"一,二,三,四,五,六,日","yValues":""}';
	}

	public function doGetSleepDataOfPage()
	{
		return '{"analysisDate":{"date":6,"day":1,"hours":17,"minutes":13,"month":6,"seconds":54,"time":1436174034209,"timezoneOffset":-480,"year":115},"avgWeekDay":0,"awakeningCount":0,"code":"404","dataPrevious":false,"daySetTsDate":null,"daySetTwDate":null,"deepSleepHoursM":0,"firstAnalysisDate":{"date":6,"day":1,"hours":17,"minutes":13,"month":6,"seconds":54,"time":1436174034209,"timezoneOffset":-480,"year":115},"getupTime":null,"memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","memberSetTsDate":{"date":4,"day":6,"hours":20,"minutes":0,"month":6,"seconds":0,"time":1436011200000,"timezoneOffset":-480,"year":115},"memberSetTwDate":{"date":5,"day":0,"hours":7,"minutes":0,"month":6,"seconds":0,"time":1436050800000,"timezoneOffset":-480,"year":115},"message":"今天没有数据。","multiDevice":false,"shllowSleepHoursM":0,"sleepHoursM":0,"sleepQuality":"","sleepTime":null,"weekSleep":0,"xLabels":"","yLabels":"","yValues":""}';
	}

	public function doGetWeixinSignatureData(){
		return '{"appId":"wx0e54f358b6eb5ce0", "timestamp":"1436167481","nonceStr":"xhR73r7F9GEANrYX","signature":"edfc8207b2e70ba4a5f133110af3d3caf04d8061"}';
	}

	public function doEditMemberData(){
		return '{"accountId":"cc10423f4a604e568a62b58dcb44ea8e","birthday":{"date":1,"day":2,"hours":0,"minutes":0,"month":0,"seconds":0,"time":473356800000,"timezoneOffset":-480,"year":85},"created":{"date":16,"day":2,"hours":16,"minutes":56,"month":5,"seconds":56,"time":1434445016000,"timezoneOffset":-480,"year":115},"deleted":0,"deptNameList":[],"enableItems":"","enableWeightGoal":false,"fatherHeight":0,"headimgurl":"http://wx.qlogo.cn/mmopen/ia5g0exKT7ZKuPBAxKwdDJceGpVIEIhibfibs2k1uJKj6IjqviapFUTalRXTEOtDcwIAicVD5EpYWhAOKdH5bt1A1feRzvnibxYtzj/0","height":179,"heightOfBirth":0,"id":"00bd2e9abb4c46a298eb6b2962dbaf3a","isFirstFollowWeight":1,"isFirstUse":0,"motherHeight":0,"name":"大山","nameForHTML":"大山","openId":"","pedometerGoal":4500,"pedometerLevel":1,"pedometerPoint":0,"pedometerSleepTs":{"date":4,"day":6,"hours":20,"minutes":0,"month":6,"seconds":0,"time":1436011200000,"timezoneOffset":-480,"year":115},"pedometerSleepTw":{"date":5,"day":0,"hours":7,"minutes":0,"month":6,"seconds":0,"time":1436050800000,"timezoneOffset":-480,"year":115},"pedometerStep":19721,"pedometerUpdateTime":null,"picture":"","pictureBytes":"","pictureUrl":"","pointUpdateStep":0,"pointUpdateTime":null,"rank":"","sessionId":"","sex":1,"ts":1436175023299,"waist":106,"weight":75,"weightGoal":70,"weightGoalOfExpireDate":null,"weightOfBirth":0}';
	}

	public function doGetDeviceInfo(){
		return '{"lt":0,"devices":[],"isNZDeivce":false,"count":1,"member":{"id":"00bd2e9abb4c46a298eb6b2962dbaf3a","accountId":"cc10423f4a604e568a62b58dcb44ea8e","name":"大山","birthday":"Jan 1, 1985 12:00:00 AM","sex":1,"weight":75.0,"height":179.0,"waist":106.0,"weightOfBirth":0.0,"heightOfBirth":0.0,"fatherHeight":0.0,"motherHeight":0.0,"enableWeightGoal":false,"weightGoal":70.0,"pedometerGoal":4500,"ts":1436236623324,"deleted":0,"created":"Jun 16, 2015 4:56:56 PM","headimgurl":"http://wx.qlogo.cn/mmopen/ia5g0exKT7ZKuPBAxKwdDJceGpVIEIhibfibs2k1uJKj6IjqviapFUTalRXTEOtDcwIAicVD5EpYWhAOKdH5bt1A1feRzvnibxYtzj/0","pedometerStep":19721,"pedometerLevel":1,"pedometerPoint":0,"pointUpdateStep":0,"pedometerSleepTs":"Jul 4, 2015 8:00:00 PM","pedometerSleepTw":"Jul 5, 2015 7:00:00 AM","isFirstUse":0,"isFirstFollowWeight":1},"is202":0}';
	}
	
	public function doGetAchievementData()
	{
	  return '{"achievementRecordList":[{"content":"累计超过6000步。","created":{"date":16,"day":2,"hours":23,"minutes":59,"month":5,"seconds":55,"time":1434470395000,"timezoneOffset":-480,"year":115},"deleted":0,"id":"cfbdb096be254a3f9961c2a014a6ba38","member_id":"00bd2e9abb4c46a298eb6b2962dbaf3a","point":0,"type":1},{"content":"重要的一天，开启我的运动之旅。","created":{"date":16,"day":2,"hours":16,"minutes":56,"month":5,"seconds":56,"time":1434445016000,"timezoneOffset":-480,"year":115},"deleted":0,"id":"babe44db7c524183ba6388b096cf8c59","member_id":"00bd2e9abb4c46a298eb6b2962dbaf3a","point":0,"type":-1}],"caloriesAVG":20.742109298706055,"cumulativeCalories":394.1000061035156,"cumulativeDistance":14280,"cumulativeStep":19721,"cumulativeTime":0,"dayStep":0,"dayStepTime":"","dekaronList":[],"dekaronning":null,"distanceAVG":751.5789794921875,"historyDekaronList":[],"imageUrl":"http://wx.qlogo.cn/mmopen/ia5g0exKT7ZKuPBAxKwdDJceGpVIEIhibfibs2k1uJKj6IjqviapFUTalRXTEOtDcwIAicVD5EpYWhAOKdH5bt1A1feRzvnibxYtzj/0","integral":18,"isSuccess":"","level":"1","list":[],"maxCaloriesByDay":191.10000610351562,"maxDistanceByDay":7050,"maxStepByDay":9685,"name":"大山","push":null,"stepAVG":1037,"weekStep":0,"weekStepTime":""}';
	}
	
	public function doGetDeviceListData()
	{
	  return '{"privatedevice":[{"id":"ca040507d6f1","sn":"1323930100513777","deviceType":"04","deviceName":"运动手环Mambo","maxUserQuantity":0,"modelNum":"LS405","communicationType":0,"password":0,"battery":0,"softwareVersion":"A013","deleted":0,"ts":0,"state":0,"carrier":"lifesense","isSupportSleep":0,"epType":0}], "publicdevice":[]}';
	}
	
	public function doGetDeviceDetailData()
	{
	  return '{"batteryPercent":71.0, "device":{"battery":0,"cardId":"","carrier":"lifesense","communicationType":4,"created":null,"deleted":0,"deviceName":"运动手环Mambo","deviceType":"04","epType":0,"hardwareVersion":"","id":"ca040507d6f1","isSupportSleep":0,"mac":"","maxUserQuantity":0,"modelNum":"LS405","modelNumC7":"","password":0,"picture":"","pictureUrl":"","qrCode":"","remark":"","saleModel":"","sessionId":"","sn":"","softwareVersion":"","state":0,"status":"","ts":0,"unit":""}, "deviceType":1, "state":0,"isjsf":1,"isPush":1,"deviceMemberCount":0}';
	}
	
	public function doGetSwitchData()
	{
	  return '[{"id":"0ca9cb959d8840c39c9f52eeace0a6c4","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","functionId":"3","sequence":1,"open":1,"name":"睡眠","url":"mod-sleep"},{"id":"d41bbb278a0c4ba7816e7542ea42a80b","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","functionId":"0","sequence":2,"open":1,"name":"运动","url":"mod-pedometer"},{"id":"77b851382d034929b1f0d5967f4c8ed7","memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a","functionId":"1","sequence":3,"open":1,"name":"挑战","url":"mod-dekaron"}]';
	}
	
	public function doGetDekaronData()
	{
	  return '{"dekaron":{"id":"3","bet":5,"bonus":20,"template":1,"valueType":3,"stepValue":0,"calorieValue":0,"distanceValue":4,"level":1,"finishTime":7,"finishType":1,"badgeId":"01addb1d0b0749fea6d8e57713da3ac3","remind":"期间任何一天没达到4公里都算失败，并没收押注5分"},"dekaronDay":0,"dekaronStep":0,"dekaronCalories":0.0,"dekaronDistance":0.0,"status":0,"template":0,"valueType":0,"pedometerPoint":0,"isSuccess":"0","updateRecordDay":0,"isfinish":0,"memberId":"00bd2e9abb4c46a298eb6b2962dbaf3a"}';
	}
}